﻿using System.ComponentModel;
#if !SILVERLIGHT
using System.Windows;
#endif

namespace FreshMeat.Xaml
{
   public static class DesignerHelper
   {
      static DesignerHelper()
      {
#if NETFX_CORE
         IsDesignMode = Windows.ApplicationModel.DesignMode.DesignModeEnabled;
#elif SILVERLIGHT 
         IsDesignMode = DesignerProperties.IsInDesignTool;
#else
         IsDesignMode = (bool)DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty, typeof(FrameworkElement)).Metadata.DefaultValue;
#endif
      }

      public static bool IsDesignMode { get; private set; }
   }
}